package model

type List struct {
	Title     string
	Path      string
	DirItems  []*DirItem
	FileItems []*FileItem
}

type DirItem struct {
	Name, Href string
}

type FileItem struct {
	Name, Href string
}

func NewList(path *Path) *List {
	return &List{
		Title:     path.GetLastLevel(),
		Path:      path.ToString(),
		DirItems:  make([]*DirItem, 0),
		FileItems: make([]*FileItem, 0),
	}
}

func (this *List) AddDirItem(item *DirItem) {
	this.DirItems = append(this.DirItems, item)
}

func (this *List) AddFileItem(item *FileItem) {
	this.FileItems = append(this.FileItems, item)
}
